import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: [
      {
        find: /\/@\//,
        replacement: path.resolve(__dirname, 'src') + '/'
      }
    ]
  },
  server: {
    proxy: {
      "/api": {
        'target': 'http://127.0.0.1:4523/m1/1299731-0-default',
        'changeOrigin': true,
        'rewrite': (path) => path.replace(/^\/api/,"")
      }
    }
  },
  plugins: [vue()],
})
